/**
 * Created by liyang on 2017/10/30.
 */
import React,{Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    Button,
    FlatList
} from 'react-native';
// import Dimensions from 'Dimensions';


export default class Sudoku extends Component{
    constructor(props) {
        super(props);
        // const Dimensions = require('Dimensions');
        // const PixelRatio = require('PixelRatio');
        // console.log(PixelRatio.get());//像素密度
        // console.log(Dimensions.get('window'));
        // console.log(Dimensions.get('window').width); //pt 逻辑像素 反应显示的真实大小
        // console.log(Dimensions.get('window').scale);//像素密度
    }

    _itemArray() {
        itemList = [];
        for (var i =0; i < 10; i++) {
            itemList.push(<View key = {i} style={styles.autoViewStyle}>
                <Text>
                    {i}
                </Text>
            </View>)
        }
        return itemList;
    }

    render() {
        return (
            <View style={styles.container}>
                {this._itemArray()}
            </View>
        )
    }

}
const Dimensions = require('Dimensions');
const wid = Dimensions.get('window').width;
const styles = StyleSheet.create({
    container: {
        //横向
        flexDirection:'row',
        //换行显示
        flexWrap:'wrap'

    },

    autoViewStyle:{
        backgroundColor:'gray',
        //设置侧抽对齐
        alignItems:'center',
        width:(wid-100)/4,
        height:50,
        marginLeft:20,
        marginTop:20
    },

    imagesStyle:{
        width:80,
        height:80

    },
    textsStyle:{


    }
});
